public class Base {
    public int num;
    public void fun(int a){
        System.out.println(a);
    }

    public static void main(String[] args) {
        Base base1 = new A();
        base1.fun(2);
        Base base2 = base1;
        A a = (A)base2;
        Base base3 = new B();
        if(base3 instanceof A){
            A a1 = (A)base3;
        }
    }
}
class B extends Base{

}
class A extends Base{
    public int n;

    @Override
    public void fun(int b){
        System.out.println(--b);
    }
}
